package com.cykj.faceledtv.adapter;

import android.support.annotation.Nullable;
import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.cykj.faceledtv.R;
import com.cykj.faceledtv.entity.RecordData;

import java.util.List;

/**
 * @author jzh
 * @date 2019/05/15 14:36
 */
public class TeamAdapter extends BaseQuickAdapter<RecordData, BaseViewHolder> {

    public TeamAdapter(@Nullable List<RecordData> data) {
        super(R.layout.adapter_team, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, RecordData item) {
        helper.setText(R.id.adapter_in_num, item.getTeamInNum() == null ? "0" : (item.getTeamInNum() + ""))
                .setText(R.id.adapter_leader, TextUtils.isEmpty(item.getTeamName()) ? "" : item.getTeamName())
                .setText(R.id.adapter_num, item.getTeamNum() == null ? "0" : (item.getTeamNum() + ""));
    }
}